package com.gtt.pattern.creational.singleton;

/**
 * Singleton
 * 
 * @author Michael(gao12581@sina.com)
 * @date 2011-2-28 09:47:24
 * 
 */
public final class Singleton {

    private static Singleton instance = null;

    private Singleton() {
        System.out.println("Singleton init...");
    }

    public static synchronized Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }

    public void operation() {
        System.out.println("singleton operation exec");
    }
}
